import { request } from '@boeyo/portal';

export const getPushList = (params: any) => {
  // return request({
  //   url: '/Push/list',
  //   method: 'get',
  //   params,
  // });
  return {
    rows: [
      {
        id: 1,
        name: 'Push1',
        color: '#EEB631',
        noticeObj: '0,1',
        noticeType: '0,1',
        createTime: '2021-01-01 00:00:00',
        status: '0',
        updateTime: '2021-01-01 00:00:00',
      },
      {
        id: 2,
        name: 'Push2',
        color: '#810000',
        description: 'Push2',
        noticeObj: '0,1',
        noticeType: '0,1',
        status: '1',
        createTime: '2021-01-01 00:00:00',
      },
    ],
    total: 1,
  };
};

/**
 * 删除告警静默
 * @param ids
 * @returns
 */
export const deletePush = (ids) => {
  return request({
    url: `alarmRule/delete/${ids}`,
    method: 'DELETE',
  });
};

/**
 * 新增告警静默
 * @param data
 * @returns
 */
export const addPush = async (data) => {
  return request({
    url: '/alarmRule/add',
    method: 'POST',
    data,
  });
};
/**
 * 更新告警静默
 * @param data
 * @returns
 */
export const updatePush = async (data) => {
  return request({
    url: '/alarmRule/add',
    method: 'PUT',
    data,
  });
};
